package pkg

import (
	"encoding/json"
	"github.com/Baidu-AIP/golang-sdk/aip/censor"
	"month/config"
)

type ConclusionStatus struct {
	ConclusionType uint64 `json:"conclusion_type"`
}

func BarrageReview(message string) bool {
	AppConf := config.AppConf.AliYun
	client := censor.NewClient(AppConf.AccessKeyID, AppConf.AccessKeySecret)
	res := client.TextCensor(message)
	var sta ConclusionStatus
	err := json.Unmarshal([]byte(res), &sta)
	if err != nil {
		return false
	}
	return true
}
